import { MPaginationRes } from "@/modules/common"
import { MDemo, EDemoType, EDemoStatus } from "@/modules/demo"
import http from '@/utils/request'

let DBList: Array<MDemo> = [];
class DemoServiceTemp {
    getList(): Promise<MPaginationRes> {
        for (let i = 1; i <= 50; i++) {
            DBList.push(
                {
                    name: "name" + i,
                    age: Math.round(Math.random() * 90),
                    type: Math.random() > 0.5 ? EDemoType.student : EDemoType.teacher,
                    status: Math.random() > 0.5 ? EDemoStatus.leave : EDemoStatus.school,
                }
            )
        }
        return Promise.resolve({
            dataList: DBList,
            total: DBList.length + 100
        });
    }
}
const DemoService = new DemoServiceTemp();
export { DemoService }